import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @ClassName LC2788
 * @Author ykx
 * @Date 2024/3/13 23:24
 * @Version 1.0
 */
public class LC2788 {
    public static void main(String[] args) {
        LC2788 lc2788 = new LC2788();
        // words = ["one.two.three","four.five","six"], separator = "."
        ArrayList<String> strings = new ArrayList<>();
        strings.add("$easy$");
        strings.add("$problem$");
        char separator = '$';
        System.out.println(lc2788.splitWordsBySeparator(strings, separator));
    }

    public List<String> splitWordsBySeparator(List<String> words, char separator) {
        List<String> result = new ArrayList<>();
        for (String word : words) {
            String[] split = word.split("\\\\" + separator);
            result.addAll(Arrays.asList(split));
        }

        return result;
    }

}
